package com.itheima.linkedlist;

import java.util.LinkedList;

public class MyStack {
    public static void main(String[] args) {
        Stack s = new Stack();
        s.push("abc");
        s.push("java");
        s.push("hello");

        System.out.println(s.pop());
        System.out.println(s.pop());
        System.out.println(s.pop());
    }

}
class Stack{
    private LinkedList<Object> list = new LinkedList<>();

    public void push(Object o){
        list.addFirst(o);
    }

    public Object pop(){
        return list.removeLast();
    }
}